package org.zcl.集合.移除集合;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @Package org.zcl.集合.移除集合
 * @PROJECT_NAME: question
 * @DESCRIPTION:
 * @USER: zhuchenglin
 * @DATE: 2021/12/15 11:11
 */
public class RemoveList {

    public static void main(String[] args) {
        List<String> bodyData = Arrays.asList("324", "234", "4", "24");
        Iterator<String> it = bodyData.iterator();
        while (it.hasNext()) {
            String activityResultPageDTO = it.next();
            if (StringUtils.equals(activityResultPageDTO, "4")) {
                it.remove();
            }
        }

        bodyData.removeIf(activityResultPageDTO -> StringUtils.equals(activityResultPageDTO, "234"));
    }
}
